 ;=============================================
 ;异常中断处理
 ;=============================================   
    AREA ExceptHandlers,CODE,READONLY
    EXPORT UndefHandler
    EXPORT SWIHandler
    EXPORT PabortHandler
    EXPORT DabortHandler
    EXPORT IRQHandler
	EXPORT FIQHandler
    IMPORT interrupt_executeIrqISR
    IMPORT interrupt_executeFiqISR
    IMPORT led_dispnum
 ;   IMPORT UndefISR
 ;   IMPORT SwiISR
 ;   IMPORT PabortISR
 ;   IMPORT DabortISR
 
INTOFFSET       EQU  0x4a000014
    ;PRESERVE8
UndefHandler
    stmfd sp!,{r0-r12,lr}
    mov r0,#10
    bl led_dispnum
    b .
;   bl UndefISR
    ldmfd sp!,{r0-r12,pc}^

SWIHandler
    stmfd sp!,{r0-r12,lr}
 ;   bl SwiDeal
    ldmfd sp!,{r0-r12,pc}^

PabortHandler
    subs lr,lr,#4
    stmfd sp!,{r0-r12,lr}
    mov r0,#12
    bl led_dispnum
    b .
;    bl PabortISR
    ldmfd sp!,{r0-r12,pc}^

DabortHandler
    subs lr,lr,#4
    stmfd sp!,{r0-r12,lr}
    mov r0,#13
    bl led_dispnum
    b .
;    bl DabortISR
    ldmfd sp!,{r0-r12,pc}^

IRQHandler
    subs lr,lr,#4
    stmfd sp!,{r0-r12,lr}
	ldr	r0,=INTOFFSET
	ldr	r0,[r0]
	bl interrupt_executeIrqISR
	ldmfd	sp!,{r0-r12,pc}^

FIQHandler
    subs lr,lr,#4
    stmfd sp!,{r0-r12,pc}
    ldr	r0,=INTOFFSET
	ldr	r0,[r0]
	bl interrupt_executeFiqISR
	ldmfd sp!,{r0-r12,pc}^
    
    END